﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.CMS.Membership;
using System.ComponentModel.DataAnnotations;

namespace MethodWorx.CMS.Requests
{
    public class CreateUserRequest
    {
        public CreateUserRequest(IUserRepository users)
        {
            this.User = users.CreateEntityInstance();
            this.User.Active = true;
        }

        protected internal User User { get; set; }

        [Required]
        [StringLength(50,ErrorMessage= "Username must be less than 50 characters")]
        public string Username
        {
            get { return this.User.Username; }
            set { this.User.Username = value; }
        }

        [Required]
        public string Password
        {
            get { return this.User.Password; }
            set { this.User.Password = value; }
        }

        public string ConfirmPassword
        {
            get;
            set;
        }

        public bool Administrator
        {
            get { return this.User.Administrator; }
            set { this.User.Administrator = value; }
        }
        
        public string FirstName {
            get { return this.User.FirstName; }
            set { this.User.FirstName = value; } 
        }

        public string LastName
        {
            get { return this.User.LastName; }
            set { this.User.LastName = value; }
        }

        public bool Active
        {
            get { return this.User.Active; }
            set { this.User.Active = value; }
        }
        
    }
}
